# Maintainer: LoveSy

_realname=pdf2svg
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.2.3
pkgrel=16
pkgdesc="A pdf to svg converter (mingw-w64)"
arch=('any')
url="http://www.cityinthesky.co.uk/opensource/pdf2svg/"
license=('GPL')
depends=("${MINGW_PACKAGE_PREFIX}-poppler")
source=(${_realname}-${pkgver}.tar.gz::https://github.com/dawbarton/pdf2svg/archive/v${pkgver}.tar.gz)
sha256sums=('4fb186070b3e7d33a51821e3307dce57300a062570d028feccd4e628d50dea8a')

build() {
  [[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST}
  mkdir -p ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST}

  ../${_realname}-${pkgver}/configure \
     --prefix=${MINGW_PREFIX} \
     --build=${MINGW_CHOST} \
     --host=${MINGW_CHOST} \
     --target=${MINGW_CHOST}
  make
}

package() {
  cd "${srcdir}"/build-${MINGW_CHOST}
  make DESTDIR="${pkgdir}" install
  
  install -Dm644 ${srcdir}/${_realname}-${pkgver}/COPYING ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING
}
